<template>
  <div>
    <!-- <div class="item_title">上级信息</div> -->
    <el-table
      :data="tableData"
      border
      style="width: 100%"
      id="out-table">
      <el-table-column
        width="130"
        prop="memberNum"
        label="会员编号">
      </el-table-column>
      <el-table-column
        prop="name"
        label="会员姓名">
      </el-table-column>
      <el-table-column
        width="55"
        prop="num"
        label="代数">
      </el-table-column>
      <el-table-column
        width="130"
        prop="introducerNum"
        label="介绍人编码">
      </el-table-column>
      <el-table-column
        prop="heightestLevel"
        label="最高级别">
      </el-table-column>
      <el-table-column
        prop="currentLevel"
        label="当月级别">
      </el-table-column>
      <el-table-column
        prop="personalSales"
        label="PPV">
      </el-table-column>
      <el-table-column
        prop="groupScore"
        label="GPV">
      </el-table-column>
      <el-table-column
        prop="personalScore"
        label="累计PPV">
      </el-table-column>
      <el-table-column
        width="150"
        prop="lastMonthScore"
        label="OPV">
      </el-table-column>
      <el-table-column
        width="110"
        prop="currentMonthScore"
        label="累计OPV">
      </el-table-column>
      <el-table-column
        prop="truePrice"
        label="紧缩销售额">
      </el-table-column>
    </el-table>
    <!-- <div class="page">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page.sync="currentPage"
        :page-size="100"
        layout="prev, pager, next, jumper"
        :total="1000">
      </el-pagination>
    </div> -->
    <!-- <el-button type="primary" @click="exportExcel" class="excelBtn">导出excel</el-button> -->
  </div>
</template>

<script>

  import FileSaver from 'file-saver'
  import XLSX from 'xlsx'
  export default {
    data() {
      return {
        currentPage:1,
        tableData: [{
          memberNum:"0000112111",
          name:"李伟",
          other:"莉莉",
          num:"05",
          introducerNum:"0000214111",
          heightestLevel:"9",
          currentLevel:"9",
          personalSales:"200",
          personalScore:"236825",
          lastMonthScore:"67093173",
          currentMonthScore:"68418906",
          groupScore:"259",
          truePrice:"411",
          IDcard:"445221199501245852"
        },{
          memberNum:"0012312111",
          name:"陈鹏",
          other:"陈宫",
          num:"04",
          introducerNum:"0000214111",
          heightestLevel:"9",
          currentLevel:"9",
          personalSales:"200",
          personalScore:"236825",
          lastMonthScore:"67093173",
          currentMonthScore:"68418906",
          groupScore:"259",
          truePrice:"411",
          IDcard:"445221199501245852"
        },{
          memberNum:"0000112111",
          name:"郑轨",
          other:"黄爱",
          num:"03",
          introducerNum:"1234534111",
          heightestLevel:"9",
          currentLevel:"9",
          personalSales:"200",
          personalScore:"236825",
          lastMonthScore:"67093173",
          currentMonthScore:"68418906",
          groupScore:"259",
          truePrice:"411",
          IDcard:"445221199501245852"
        },{
          memberNum:"0412536511",
          name:"黄辉",
          other:"陈皮",
          num:"02",
          introducerNum:"0000214111",
          heightestLevel:"9",
          currentLevel:"9",
          personalSales:"200",
          personalScore:"236825",
          lastMonthScore:"67093173",
          currentMonthScore:"68418906",
          groupScore:"259",
          truePrice:"411",
          IDcard:"445221199501245852"
        },{
          memberNum:"0000112111",
          name:"蔡鹏",
          other:"黄莉",
          num:"01",
          introducerNum:"0000211141",
          heightestLevel:"9",
          currentLevel:"9",
          personalSales:"200",
          personalScore:"236825",
          lastMonthScore:"67093173",
          currentMonthScore:"68418906",
          groupScore:"259",
          truePrice:"411",
          IDcard:"445221199501245852"
        },]
      }
    },
    methods:{
      // 分页
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
      },
      exportExcel () {
         /* generate workbook object from table */
         var wb = XLSX.utils.table_to_book(document.querySelector('#out-table'))
         /* get binary string as output */
         var wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' })
         try {
             FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), 'sheetjs.xlsx')
         } catch (e) { if (typeof console !== 'undefined') console.log(e, wbout) }
         return wbout
     },
    }
  }
</script>
<style scoped>

</style>
